import { getCities } from '../utils/index.js'
// query-string:将地址栏的参数解析为一个对象
import qs from 'query-string'
import $ from 'jquery'

const params = qs.parse(location.search)
$('.title').text(params.name)

getCities(params.id).then((res) => {
  const dl = $('dl')
  for (const c of res) {
    $('<dd>').text(c.simpleName).appendTo(dl)
  }
})
